package com.lightboat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 物流状态
 *
 * @author lightboat
 */
@Getter
@AllArgsConstructor
public enum LogisticsStatus {
    PENDING_SHIPMENT("0", "待发货"),
    SIGNED("1", "已签收"),
    REFUSAL_SIGN_RECEIPT("2", "拒绝签收"),
    SHIPPED("3", "已发货"),
    CANCELED("4", "取消"),
    INTERCEPTING("5", "拦截中"),
    INTERCEPT_SUCCESS("6", "拦截成功");

    private final String code;
    private final String message;

    public LogisticsStatus getByCode(Integer code) {
        for (LogisticsStatus value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}